<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>欢迎</title>
    <script src="js/jquery-3.7.1.js"></script>
</head>
<body>
欢迎<span id="name"></span>
</body>
<script>
    var name = localStorage.getItem("userName");
    $("#name").text(name)
</script>
</html>